---------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_A6_Results.log
  log type:  text
 opened on:  15 May 2024, 11:44:14

. eststo clear

. use "$rootpath/processed_data/Estimation_Data.dta", clear

. drop if key_estimation_sample==0
(273,947 observations deleted)

. sort state_number

. gen temp_id=facility_id if post==0
(335,334 missing values generated)

. egen num_facil_temp=nvals(temp_id), by(state_number)
(335334 missing values generated)

. egen num_facilities=max(num_facil_temp), by(state_number)

. sort facility_id year

. egen years_observed=nvals(year), by(facility_id)

. 
. ///This is definition zero.
> //Note definition zero is mandatory to the extent that we want to show how we define the matrix codes doesn't matter. 
. drop treatXpost

. gen treatXpost=avg_old_code_prob2*post

. 
. reghdfe  log_damage55 treatXpost if key_estimation_sample==1, absorb(facility_id n5#year) vce(cluster facility_id)
(MWFE estimator converged in 245 iterations)

HDFE Linear regression                            Number of obs   =    699,013
Absorbing 2 HDFE groups                           F(   1,  81431) =       8.82
Statistics robust to heteroskedasticity           Prob > F        =     0.0030
                                                  R-squared       =     0.9406
                                                  Adj R-squared   =     0.9320
                                                  Within R-sq.    =     0.0001
Number of clusters (facility_id) =     81,432     Root MSE        =     0.3626

                       (Std. Err. adjusted for 81,432 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0406347   .0136814    -2.97   0.003    -.0674501   -.0138193
       _cons |   .8616137   .0016888   510.20   0.000     .8583037    .8649236
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     81432       81432           0    *|
     n5#year |      6834           1        6833     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store damage_d1

. 
. ///This is emissions definition zero 
> reghdfe  log_emissions4 treatXpost if key_estimation_sample==1, absorb(facility_id n5#year) vce(cluster facility_id)
(MWFE estimator converged in 248 iterations)

HDFE Linear regression                            Number of obs   =    699,013
Absorbing 2 HDFE groups                           F(   1,  81431) =       5.23
Statistics robust to heteroskedasticity           Prob > F        =     0.0222
                                                  R-squared       =     0.9415
                                                  Adj R-squared   =     0.9330
                                                  Within R-sq.    =     0.0000
Number of clusters (facility_id) =     81,432     Root MSE        =     0.3081

                       (Std. Err. adjusted for 81,432 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0265879   .0116253    -2.29   0.022    -.0493733   -.0038024
       _cons |   .7063664    .001435   492.25   0.000     .7035539     .709179
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     81432       81432           0    *|
     n5#year |      6834           1        6833     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store emission_d1

.  
. ///This is definition two
> drop treatXpost

. gen treatXpost=(state_delisted_hpvs/num_facilities)*post

. replace treatXpost=0 if treatXpost==.
(0 real changes made)

.  
. reghdfe  log_damage55 treatXpost if key_estimation_sample==1, absorb(facility_id n5#year) vce(cluster facility_id)
(MWFE estimator converged in 245 iterations)

HDFE Linear regression                            Number of obs   =    699,013
Absorbing 2 HDFE groups                           F(   1,  81431) =     128.59
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9407
                                                  Adj R-squared   =     0.9321
                                                  Within R-sq.    =     0.0009
Number of clusters (facility_id) =     81,432     Root MSE        =     0.3624

                       (Std. Err. adjusted for 81,432 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -1.443566   .1273017   -11.34   0.000    -1.693077   -1.194056
       _cons |   .8670063   .0009179   944.58   0.000     .8652073    .8688053
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     81432       81432           0    *|
     n5#year |      6834           1        6833     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store damage_d2

. 
. 
. ///This is for emissions with definition two. 
> reghdfe   log_emissions4  treatXpost if key_estimation_sample==1, absorb(facility_id n5#year) vce(cluster facility_id)
(MWFE estimator converged in 248 iterations)

HDFE Linear regression                            Number of obs   =    699,013
Absorbing 2 HDFE groups                           F(   1,  81431) =     211.94
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9416
                                                  Adj R-squared   =     0.9331
                                                  Within R-sq.    =     0.0016
Number of clusters (facility_id) =     81,432     Root MSE        =     0.3079

                       (Std. Err. adjusted for 81,432 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -1.636195   .1123903   -14.56   0.000    -1.856479   -1.415911
       _cons |   .7148818   .0008104   882.18   0.000     .7132935    .7164701
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     81432       81432           0    *|
     n5#year |      6834           1        6833     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store emission_d2

.   
. esttab damage_d1 damage_d2 emission_d1 emission_d2 using "$rootpath/table_graph/TBL_A6.tex",  star( * 0.1 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par
>  fmt(3))) keep(treatXpost _cons) scalars(N F) ar2 replace 
(note: file /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/TBL_A6.tex not found)
(output written to /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/TBL_A6.tex)

. log close
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_A6_Results.log
  log type:  text
 closed on:  15 May 2024, 11:46:18
---------------------------------------------------------------------------------------------------------------------------------------------------------
